import request from '@/utils/request'

// 查询货品信息列表
export function listProduct(query) {
  return request({
    url: '/product/product/list',
    method: 'get',
    params: query
  })
}

// 查询货品信息详细
export function getProduct(productId) {
  return request({
    url: '/product/product/' + productId,
    method: 'get'
  })
}
// 查询货品信息列表
export function selectquery(warehouseId) {
  return request({
    url: '/product/product/warehouse/' + warehouseId,
    method: 'get'
  })
}
// 查询货品信息列表
export function selectquery1(warehouseId1) {
  return request({
    url: '/product/product/warehouse/' + warehouseId1,
    method: 'get'
  })
}

// 新增货品信息
export function addProduct(data) {
  return request({
    url: '/product/product/',
    method: 'post',
    data: data
  })
}

// 修改货品信息
export function updateProduct(data) {
  return request({
    url: '/product/product',
    method: 'put',
    data: data
  })
}
// 修改货品信息
export function xgai(data) {
  return request({
    url: '/product/product/xgai',
    method: 'put',
    data: data
  })
}

// 删除货品信息
export function delProduct(productId) {
  return request({
    url: '/product/product/' + productId,
    method: 'delete'
  })
}


// 获取编码
export function getCode(code) {
  return request({
    url: '/product/product/getcode?code=' + code,
    method: 'post'
  })
}

//获取供应商下拉列表框值
export function selectPySuppliers() {
  return request({
    url: '/product/product/selectPySuppliers',
    method: 'get'
  })
}

//查询所有商品
export function selectAllProduct(query) {
  return request({
    url: '/product/product/selectByProduct',
    method: 'post',
    params: query
  })
}



//查询详情
export function selectProductDetails(productId) {
  return request({
    url: '/product/product/selectProductDetails?productId='+productId,
    method: 'get'
  })
}


